<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="步骤4：注册PostgreSQL集群实例下的数据库">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001792402592.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
<meta name="DC.Publisher" content="20240320">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001792562372">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>步骤4：注册PostgreSQL集群实例下的数据库</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000001792562372"></a><a name="ZH-CN_TOPIC_0000001792562372"></a>

<h1 class="topictitle1">步骤4：注册PostgreSQL集群实例下的数据库</h1>
<div><div class="section"><h4 class="sectiontitle">前提条件</h4><ul><li>注册PostgreSQL集群实例前，请确保集群中每个主机已进行注册。<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>要求集群中所有主机已注册相同名称的数据库。</p>
</div></div>
<p>具体操作请参见<a href="zh-cn_topic_0000001792562448.html">步骤3：注册PostgreSQL单实例下的数据库</a>。</p>
</li><li>执行实例注册前，请检查数据库安装路径下bin/lib/share文件属主是否为root，若是root请在/opt/DataBackup/ProtectClient/Plugins/GeneralDBPlugin/bin/applications/postgresql/conf/switch.conf配置文件中将enable_root配置项取值设置为1。</li><li>注册PostgreSQL集群前，请先查询集群类型。<p><strong>Pgpool集群</strong></p>
<ol><li>使用PuTTY，登录PostgreSQL数据库主机。</li><li>执行<strong>which pgpool</strong>命令，查询是否是Pgpool集群。<ul><li>如果回显为Pgpool集群所在路径，则表示集群类型为Pgpool集群，查询结束。</li><li>如果回显为no pgpool，则表示未查询到Pgpool集群，请继续执行以下操作。</li></ul>
</li><li>执行<strong>whereis pgpool</strong>命令，查询是否是Pgpool集群。<ul><li>如果回显为Pgpool集群所在路径，则表示集群类型为Pgpool集群，查询结束。</li><li>如果回显为pgpool:，则说明当前集群类型不是Pgpool集群。</li></ul>
</li></ol>
<p><strong>Patroni集群</strong></p>
<ol><li>使用PuTTY，登录PostgreSQL数据库主机。</li><li>执行<strong>which patroni</strong>命令，查询是否是Patroni集群。<ul><li>如果回显为Patroni集群所在路径，则表示集群类型为Patroni集群，查询结束。</li><li>如果回显为no patroni，则表示未查询到Patroni集群，请继续执行以下操作。</li></ul>
</li><li>执行<strong>whereis patroni</strong>命令，查询是否是Patroni集群。<ul><li>如果回显为Patroni集群所在路径，则表示集群类型为Patroni集群，查询结束。</li><li>如果回显为patroni:，则说明当前集群类型不是Patroni集群。</li></ul>
</li></ol>
</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">操作步骤</h4><ol><li><span>创建集群。</span><p><ol type="a"><li>在PostgreSQL页面选择<span class="uicontrol">“集群”</span>页签。</li><li>单击<span class="uicontrol">“注册”</span>。</li><li>在<span class="uicontrol">“注册”</span>页面，自定义集群名称和虚拟IP地址并选择类型和集群节点。</li><li>单击<span class="uicontrol">“确定”</span>。</li></ol>
</p></li><li><span>注册集群实例下的数据库。</span><p><ol type="a"><li>在PostgreSQL页面选择<span class="uicontrol">“实例”</span>页签。</li><li>单击<span class="uicontrol">“注册”</span>。</li><li><span class="uicontrol">“<span>类型</span>”</span>选择<span class="uicontrol">“<span>集群实例</span>”</span>。</li><li>配置数据库实例及其认证信息。<p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001792562372__table12398130131217">表1</a>所示。</p>

<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001792562372__table12398130131217"></a><a name="table12398130131217"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792562372__table12398130131217" frame="border" border="1" rules="all"><caption><b>表1 </b>PostgreSQL集群实例注册信息</caption><colgroup><col style="width:28.050000000000004%"><col style="width:71.95%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="28.050000000000004%" id="mcps1.3.2.2.2.2.1.4.2.2.3.1.1"><p>参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="71.95%" id="mcps1.3.2.2.2.2.1.4.2.2.3.1.2"><p>说明</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>名称</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>安装数据库的用户名称。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>集群</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>选择要注册的数据库主机。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>用户名</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>运行数据库的操作系统用户名。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>Pgpool端口</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>当集群选择为<span style="color:#282B33;">Patroni集群的数据库主机时不展示该参数</span>。</p>
<p>Pgpool服务侦听TCP/IP连接的端口号。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>数据库用户名</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>数据库的管理员用户名称。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>数据库密码</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>数据库管理员用户的密码。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>数据库流复制用户名</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>数据库用于流复制的用户名称。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="28.050000000000004%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.1 "><p><span>数据库流复制用户密码</span></p>
</td>
<td class="cellrowborder" valign="top" width="71.95%" headers="mcps1.3.2.2.2.2.1.4.2.2.3.1.2 "><p>数据库用于流复制用户的密码。</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li>单击“添加”，在弹出的添加对话框中添加集群实例下的所有节点。<p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001792562372__zh-cn_topic_0000001311214069_table241515964115">表2</a>所示。</p>

<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001792562372__zh-cn_topic_0000001311214069_table241515964115"></a><a name="zh-cn_topic_0000001311214069_table241515964115"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792562372__zh-cn_topic_0000001311214069_table241515964115" frame="border" border="1" rules="all"><caption><b>表2 </b>集群实例的节点信息</caption><colgroup><col style="width:25.629999999999995%"><col style="width:74.37%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="25.629999999999995%" id="mcps1.3.2.2.2.2.1.5.2.2.3.1.1"><p>参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="74.37%" id="mcps1.3.2.2.2.2.1.5.2.2.3.1.2"><p>说明</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p><span>主机</span></p>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>选择集群下的主机节点。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p><span>数据库安装路径</span></p>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>要注册的数据库安装路径。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p>Patroni配置文件完整路径</p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p>仅在1.6.0及后续版本展示该参数。</p>
</div></div>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>配置集群实例时，集群选择为<span style="color:#282B33;">Patroni集群的数据库主机，添加集群实例节点可展示该参数</span>。</p>
<p>Patroni配置文件完整路径。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p><span>Pgpool安装路径</span></p>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>Pgpool服务的安装路径。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p><span>业务IP地址</span></p>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>数据库服务接收TCP/IP连接的主机IP地址。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.1 "><p><span>数据库端口</span></p>
</td>
<td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.2.2.2.2.1.5.2.2.3.1.2 "><p>数据库服务侦听TCP/IP连接的端口号。</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li>依次选择每个集群成员的已注册的实例名称。</li><li>单击<span class="uicontrol">“确定”</span>。</li></ol>
</p></li></ol>
</div>
<p></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>父主题：</strong> <a href="zh-cn_topic_0000001792402592.html">备份PostgreSQL</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>